package com.kmk.phonetuition;

import java.util.ArrayList;

import android.app.Application;
import android.content.Intent;
import android.content.res.Configuration;
import com.kmk.phonetuition.R;

public class Phonetuition extends Application {

		ArrayList<ConditionWithSettings> userConfigurationList = null;	/* Maintain a list of ConditionsWithSettings */
	
		/* (non-Javadoc)
		 * @see android.app.Application#onConfigurationChanged(android.content.res.Configuration)
		 */
		@Override
		public void onConfigurationChanged(Configuration newConfig) {
			// TODO Auto-generated method stub
			super.onConfigurationChanged(newConfig);
		}

		/* (non-Javadoc)
		 * @see android.app.Application#onCreate()
		 */
		@Override
		public void onCreate() {
			
			try {
				
				if( userConfigurationList == null ) {
					userConfigurationList  = new ArrayList<ConditionWithSettings>();
				}
				
				/* Start the SettingsService */
				Intent settingsServiceIntent = new Intent(this, SettingsService.class);
				startService(settingsServiceIntent);
				
			}catch(Exception e) {
				
				System.out.println("Trying to start Settings Service, Caught exception: " + e );
				
			}

			super.onCreate();
		}

		/* (non-Javadoc)
		 * @see android.app.Application#onLowMemory()
		 */
		@Override
		public void onLowMemory() {
			// TODO Auto-generated method stub
			super.onLowMemory();
		}

		/* (non-Javadoc)
		 * @see android.app.Application#onTerminate()
		 */
		@Override
		public void onTerminate() {
			// TODO Auto-generated method stub
			super.onTerminate();
		}

}
